deal with empty option

stvnrlly 10 years ago
parent
commit
09647798e7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/models/agents/user_location_agent.rb

+ 1 - 1
app/models/agents/user_location_agent.rb

@@ -73,7 +73,7 @@ module Agents
73 73
     def handle_payload(payload)
74 74
       location = Location.new(payload)
75 75
 
76
-      if (location.present? && (payload["accuracy"] < interpolated[:max_accuracy]))
76
+      if location.present? && (!interpolated[:max_accuracy].present? || payload["accuracy"] < interpolated[:max_accuracy])
77 77
         create_event payload: payload, location: location
78 78
       end
79 79
     end